package com.springlistener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.context.support.RequestHandledEvent;
import static com.util.Printer.print;

/**
 * @Author Fizz Pu
 * @Date 2021/4/28 下午10:39
 * @Version 1.0
 * 失之毫厘，缪之千里！
 */

@Component
public class WebListener implements ApplicationListener<RequestHandledEvent> {

    @Override
    public void onApplicationEvent(RequestHandledEvent event) {
        // 处理web请求时间
        print("web 请求来了");
        print(event.getDescription());
    }
}
